Skip to content

fix(opencode): correct Codex OAuth GPT-5.6 context window - #39082

Open
GameOn223 wants to merge 1 commit into
anomalyco:devfrom
GameOn223:fix/codex-oauth-gpt56-context-window
Open

fix(opencode): correct Codex OAuth GPT-5.6 context window#39082
GameOn223 wants to merge 1 commit into
anomalyco:devfrom
GameOn223:fix/codex-oauth-gpt56-context-window

Conversation

@GameOn223

@GameOn223 GameOn223 commented Jul 27, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #38976

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The Codex OAuth transform still pins GPT-5.6 Sol/Terra/Luna to a 372k input window. OpenAI corrected those context windows to 272k in Codex CLI 0.144.6, so we were letting sessions run past the window the Codex harness itself advertises, which delays compaction.

Codex 0.145.0's bundled models.json reports context_window: 272000 for all three 5.6 variants — the same as 5.5. Since the two branches now produce an identical object, I merged them rather than duplicating it.

Only affects the OAuth path; API-key metadata still uses the provider's own limits.

How did you verify your code works?

Pulled models.json from openai/codex at rust-v0.145.0 and confirmed gpt-5.6-sol, gpt-5.6-terra and gpt-5.6-luna all report context_window and max_context_window of 272000.

The existing test in packages/opencode/test/plugin/codex.test.ts asserted the old 500k/372k values, so I updated those three expectations and ran:

bun test test/plugin/codex.test.ts

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

OpenAI corrected the GPT-5.6 Sol, Terra and Luna context windows to 272k in
Codex CLI 0.144.6, and 0.145.0's bundled models.json still reports 272000 for
all three. The OAuth transform kept the earlier 372k input override, which
delays compaction past the window the Codex harness advertises.

That makes 5.6 identical to 5.5, so the two branches collapse into one.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found Related PR

PR #38987: fix(core): honor Codex input limits

This PR is related to your current PR #39082. Both address Codex model limits and input handling. PR #38987 focuses on the core layer honoring Codex input limits, while your PR corrects the OAuth transform's GPT-5.6 context window from 372k to 272k. These appear to be complementary fixes for the same issue (#38976) affecting different layers of the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI Codex OAuth GPT-5.6 limits stale after Codex 0.144.6 correction

1 participant